<extend name="Common@Layout:hui-admin" />
<block name="title"><title>Administator管理后台</title></block>
<block name="style">

</block>

<block name="main">
<div class="pd-20">
	<form action="{:u('editclasstype_post')}" method="post" class="form form-horizontal validator_form close-dialog" id="form-article-add">
		
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>分类名称：</label>
			<div class="formControls col-6">
			  	<input type="text" class="input-text" value="{$info.title}" placeholder="" name="title"  data-rule="班级名称:required;">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>对象(岁)：</label>
			<div class="formControls col-2">
			  	<input type="text" class="input-text" style="width:50px;" value="{$info.target1}" placeholder="" name="target1" data-target="#error"  data-rule="对象区间:required;">
				-
				<input type="text" class="input-text" style="width:50px;" value="{$info.target2}" placeholder="" name="target2" data-target="#error"  data-rule="对象区间:required;">
			</div>
			
			<div class="col-4" id="error"> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-2"><span class="c-red">*</span>总课时：</label>
			<div class="formControls col-2">
			  	<input type="text" class="input-text" value="{$info.worktotal}" placeholder="" name="worktotal"  data-rule="总课时:required;integer[+];filter">
			</div>
			<label class="form-label col-2"><span class="c-red">*</span>课次：</label>
			<div class="formControls col-2">
			  	<input type="text" class="input-text" value="{$info.worknum}" placeholder="" name="worknum"  data-rule="课次:required;integer[+];filter">
			</div>
			<div class="col-4"> </div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-2">备注：</label>
			<div class="formControls col-6">
				<textarea name="remark" cols="" rows="" class="textarea"  placeholder="" >{$info.remark}</textarea>
			</div>
		</div>
		<div class="line mt-20"></div>
		<div class="row cl">
			<div class="col-6">
				<div class="row cl text-c"><b>一年</b></div>
				<div class="row cl">
					<label class="form-label col-4"><span class="c-red">*</span>学费：</label>
					<div class="formControls col-4">
					  	<input type="text" class="input-text" value="{$info.total}" placeholder="" name="total"  data-rule="学费:required;price;" data-rule-price="[/^\d{1,10}(\.\d{1,2})?$/,'格式不正确']">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-4"><span class="c-red">*</span>材料费：</label>
					<div class="formControls col-4">
					  	<input type="text" class="input-text" value="{$info.materialcost|default='0'}" placeholder="" name="materialcost"  data-rule="材料费:required;price;" data-rule-price="[/^\d{1,10}(\.\d{1,2})?$/,'格式不正确']">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-4">新生优惠：</label>
					<div class="formControls col-4">
					  	<input type="text" class="input-text" value="{$info.discount}" placeholder="" name="discount">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-4">老生优惠：</label>
					<div class="formControls col-4">
					  	<input type="text" class="input-text" value="{$info.olddiscount}" placeholder="" name="olddiscount">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-4">老生备注：</label>
					<div class="formControls col-6">
						<textarea name="desc" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" onKeyUp="textarealength(this,200)">{$info.desc}</textarea>
					</div>
				</div>
			</div>
			<div class="col-6">
				<div class="row cl text-c"><b>试学半年</b></div>
				<div class="row cl">
					<label class="form-label col-4"><span class="c-red">*</span>学费：</label>
					<div class="formControls col-4">
					  	<input type="text" class="input-text" value="{$info.total_mid}" placeholder="" name="total_mid"  data-rule="学费:required;price;" data-rule-price="[/^\d{1,10}(\.\d{1,2})?$/,'格式不正确']">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-4"><span class="c-red">*</span>材料费：</label>
					<div class="formControls col-4">
					  	<input type="text" class="input-text" value="{$info.materialcost_mid|default='0'}" placeholder="" name="materialcost_mid"  data-rule="材料费:required;price;" data-rule-price="[/^\d{1,10}(\.\d{1,2})?$/,'格式不正确']">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-4">新生优惠：</label>
					<div class="formControls col-4">
					  	<input type="text" class="input-text" value="{$info.discount_mid}" placeholder="" name="discount_mid">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-4">老生优惠：</label>
					<div class="formControls col-4">
					  	<input type="text" class="input-text" value="{$info.olddiscount_mid}" placeholder="" name="olddiscount_mid">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-4">老生备注：</label>
					<div class="formControls col-6">
						<textarea name="desc_mid" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" onKeyUp="textarealength(this,200)">{$info.desc_mid}</textarea>
					</div>
				</div>
			</div>
		</div>
	  	<div class="row cl">
	    	<div class="col-9 col-offset-2">
	    		<input type="hidden" name="id" value="{$info['id']}">
	    		<if condition="$info">
	    		<input type="hidden" name="cid" value="{$info['cid']}"/>
	    		<else/>
	    		<input type="hidden" name="cid" value="{$cid}"/>
	    		</if>
	      		<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
	    		<if condition="$info">
	    		<a class="btn btn-primary radius" onclick="parent.Hui_admin_tab(this)" _href="{:U('remarkadmin/index',array('ctid'=>$info['id']))}" data-title="关联学期备注"><i class="Hui-iconfont"></i> 关联学期备注</a>
	    		</if>
	    	</div>
	  	</div>
	</form>
</div>
</block>

<block name="script">
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$('.mini-time').datepicker();
	
	//$("input[name='worknum']").blur(function(){
	//	get_total();
	//});
	//$("input[name='price']").blur(function(){
	//	get_total();
	//});
	//$("input[name='materialcost']").blur(function(){
	//	get_total();
	//});

	//function get_total(){
	//	var total;
	//	var worknum = $("input[name='worknum']").val();//课次
	//	var price = $("input[name='price']").val();//单价
	//	var materialcost = $("input[name='materialcost']").val();//材料费
	//	if(worknum !=='' && price !=='' && materialcost!==''){
	//		total = (parseFloat(price)+parseFloat(materialcost))*parseInt(worknum);
	//		$("input[name='total']").val(total);
	//	}
	//}

});
</script>
</block>